home *** CD-ROM | disk | FTP | other *** search
- uwhois {
- if ($1 == $null) {
- iecho Syntax: /uwhois <user> [command]
- return
- }
- if ($2) set %uwhois.cmd $2-
- else set %uwhois.cmd iiecho
- if ($usrhost($1) == $null) {
- if ($usr($1)) iecho Can't find $hc($1) on userlist, try $hc($usr($1)) instead.
- else iecho Can't find $hc($1) on userlist.
- return
- }
- if ($readini users.ini $1 password != $null) set %uwhois.pass yes
- else set %uwhois.pass no
- if ($readini users.ini $1 botpass != $null) set %uwhois.bpass yes
- else set %uwhois.bpass no
- if (0) set %uwhois.notes 0
- else set %uwhois.notes N/A
- set %uwhois.seen $readini -n users.ini $1 seen
- :begin
- %uwhois.cmd $fix(9,HANDLE) PASS BOTPASS NOTES $fix(17,FLAGS) LAST
- %uwhois.cmd $fix(9,$1) $fix(4,%uwhois.pass) $fix(7,%uwhois.bpass) $fix(5,%uwhois.notes) $fix(17,$flags($1)) $iif(%uwhois.seen,$asctime($gettok(%uwhois.seen,1,32),h:nntt),never)
- set %uwhois.i 0
- :flags
- inc %uwhois.i
- if ($gettok($usrchans($1),%uwhois.i,44)) {
- %uwhois.cmd $fix(26,$gettok($usrchans($1),%uwhois.i,44)) $cflags($1,$gettok($usrchans($1),%uwhois.i,44))
- if ($infoline($1,$gettok($usrchans($1),%uwhois.i,44))) %uwhois.cmd #INFO: $infoline($1,$gettok($usrchans($1),%uwhois.i,44))
- goto flags
- }
- set %uwhois.i 0
- :start
- inc %uwhois.i
- set %uwhois.host $hstmask($1,%uwhois.i)
- if (%uwhois.host != $null) {
- if (%uwhois.i == 1) %uwhois.cmd $lfix(8,HOSTS:) %uwhois.host
- else %uwhois.cmd $fix(8,) %uwhois.host
- goto start
- }
- if ($infoline($1)) %uwhois.cmd $lfix(7,INFO:) $infoline($1)
- unset %uwhois.*
- }
- adduser {
- if ($1 == $null) {
- iecho Syntax: /adduser <username> [hostmask] [nickname] [pass]
- return
- }
- if ($1 == Users) {
- iecho Invalid username.
- return
- }
- if ($usrhost($1)) {
- iecho Error! User $hc($1) already exists!
- return
- }
- if ($2) set %adduser.addr $2
- elseif ($address($1,3)) set %adduser.addr $address($1,3)
- else {
- iecho No hostmask supplied and user is not online!
- return
- }
- if ($readini -n users.ini users %adduser.addr != $null) {
- iecho Error! Someone is already using that hostmask!
- return
- }
- .auser 40 %adduser.addr
- .save -ru users.mrc
- writeini -n users.ini Users %adduser.addr $1
- writeini -n users.ini $1 hostmask %adduser.addr
- writeini -n users.ini $1 flags -
- if ($3) {
- qnotice $3 You have been added to my userlist.
- qnotice $3 Type /ctcp $me HELP for command info
- }
- if ($4) {
- crypt 0 $lower($1) $4
- writeini -n users.ini $1 password $result
- qnotice $3 Your password has been set to ' $+ $4 $+ '
- }
- elseif ($3) qnotice $3 You have no password set, please set one.
- colupdt3 %adduser.addr
- if ($show) iecho Added $hc($1) with hostmask $sc(%adduser.addr) $+ .
- unset %adduser.*
- }
- addbot {
- if ($1 == $null) {
- iecho Syntax: /addbot <username> [hostmask] [pass]
- return
- }
- if ($1 == Users) {
- iecho Invalid username.
- return
- }
- if ($usrhost($1)) {
- iecho Error! User $hc($1) already exists!
- return
- }
- if ($2) set %adduser.addr $2
- elseif ($address($1,1)) set %adduser.addr $address($1,1)
- else {
- iecho No hostmask supplied and user is not online!
- return
- }
- if ($readini -n users.ini users %adduser.addr != $null) {
- iecho Error! Someone is already using that hostmask!
- return
- }
- .auser 40 %adduser.addr
- .save -ru users.mrc
- writeini -n users.ini Users %adduser.addr $1
- writeini -n users.ini $1 hostmask %adduser.addr
- writeini -n users.ini $1 flags b
- if ($3) {
- crypt 0 $lower($1) $3
- writeini -n users.ini $1 botpass $result
- }
- colupdt3 %adduser.addr
- if ($show) iecho Added bot $hc($1) with hostmask $sc(%adduser.addr) $+ .
- unset %adduser.*
- }
- chattr {
- if ($1 == $null) {
- iecho Syntax: /chattr <username> [[+|-]flags [channel]]
- return
- }
- elseif ($usrhost($1) == $null) {
- if ($usr($1)) iecho Can't find $hc($1) on userlist, try $hc($usr($1)) instead.
- else iecho Can't find $hc($1) on userlist.
- return
- }
- if ($3) {
- if ($findtok($usrchans($1),$3,1,44) == $null) addchan $1 $3
- set %tmp.chattr $cflags($1,$3)
- }
- else set %tmp.chattr $flags($1)
- if ((+ isin $2) || (- isin $2)) {
- set %i.chattr 0
- unset %j.chattr
- :start
- inc %i.chattr
- if ($mid($2,%i.chattr,1) != $null) {
- if ($mid($2,%i.chattr,1) == +) set %j.chattr +
- elseif ($mid($2,%i.chattr,1) == -) set %j.chattr -
- else {
- if (%j.chattr == +) set %tmp.chattr - $+ $removecs(%tmp.chattr,$mid($2,%i.chattr,1),-) $+ $mid($2,%i.chattr,1)
- elseif (%j.chattr == -) set %tmp.chattr - $+ $removecs(%tmp.chattr,$mid($2,%i.chattr,1),-)
- }
- goto start
- }
- }
- else set %tmp.chattr $2
- if ($3) {
- if ($remove(%tmp.chattr,-) != $null) {
- writeini -n users.ini $1 $3 $remove(%tmp.chattr,-)
- colupdt2 $1
- if ($show) iecho Channel flags for $hc($1) in $sc($3) are now $hc($remove(%tmp.chattr,-))
- return
- }
- writeini -n users.ini $1 $3 -
- colupdt2 $1
- if ($show) iecho Removed flags for $hc($1) in $sc($3)
- }
- elseif ($2) {
- if ($remove(%tmp.chattr,-) != $null) {
- writeini -n users.ini $1 flags $remove(%tmp.chattr,-)
- colupdt2 $1
- if ($show) iecho Global flags for $hc($1) are now $hc($remove(%tmp.chattr,-))
- return
- }
- writeini -n users.ini $1 flags -
- colupdt2 $1
- if ($show) iecho Removed global flags for $hc($1)
- }
- elseif ($3) {
- if ($flags($1) != -) iecho Global flags for $hc($1) are $hc($flags($1))
- else iecho $hc($1) has no global flags
- }
- }
- addchan {
- if ($2 == $null) iecho Syntax: /addchan <username> <#channel>
- elseif ($usrhost($1) == $null) iecho Can't find $hc($1) on userlist.
- elseif ($findtok($usrchans($1),$2,1,44)) iecho Channel record already exists!
- else {
- writeini -n users.ini $1 channels $addtok($usrchans($1),$2,44)
- writeini -n users.ini $1 $2 -
- if ($show) iecho Added channel $sc($2) to $hc($1)
- }
- }
- remchan {
- if ($2 == $null) iecho Syntax: /remchan <username> <#channel>
- elseif ($usrhost($1) == $null) iecho Can't find $hc($1) on userlist.
- elseif ($findtok($usrchans($1),$2,1,44) == $null) iecho $sc($2) not in channels for $hc($1)
- else {
- if ($usrchans($1) == $2) remini users.ini $1 channels
- else writeini -n users.ini $1 channels $remtok($usrchans($1),$2,1,44)
- remini users.ini $1 $2
- remini users.ini $1 infoline. [ $+ [ $2 ] ]
- if ($show) {
- iecho Removed channel $sc($2) from $hc($1)
- iecho This includes any info-line set for that channel.
- }
- }
- }
- remuser {
- if ($1 == $null) {
- iecho Syntax: /remuser <user>
- return
- }
- elseif ($usrhost($1) == $null) {
- iecho Error! No such user $hc($1)
- return
- }
- set %i.remuser 0
- :start
- inc %i.remuser
- if ($hstmask($1,%i.remuser)) {
- .ruser 40 $hstmask($1,%i.remuser)
- .timer 1 0 colupdt3 $hstmask($1,%i.remuser)
- remini users.ini Users $hstmask($1,%i.remuser)
- goto start
- }
- remini users.ini $1
- if ($show) iecho Removed user entry for $hc($1)
- }
- chpass {
- if ($1 == $null) {
- iecho Syntax: /chpass <user> [password]
- return
- }
- elseif ($usrhost($1) == $null) {
- if ($usr($1)) iecho Can't find $hc($1) on userlist, try $hc($usr($1)) instead.
- else iecho Can't find $hc($1) on userlist.
- return
- }
- if ($len($2) > 3) {
- crypt 0 $lower($1) $2
- writeini -n users.ini $1 password $result
- if ($show) iecho Changed password for $hc($1)
- }
- elseif ($2) iecho Password too short! Use at least 4 characters.
- else {
- remini users.ini $1 password
- if ($show) iecho Removed password for $hc($1)
- }
- }
- chbotpass {
- if ($1 == $null) {
- iecho Syntax: /chbotpass <user> [password]
- return
- }
- elseif ($usrhost($1) == $null) {
- if ($usr($1)) iecho Can't find $hc($1) on userlist, try $hc($usr($1)) instead.
- else iecho Can't find $hc($1) on userlist.
- return
- }
- if ($2 != $null) {
- crypt 0 $lower($1) $2
- writeini -n users.ini $1 botpass $result
- if ($show) iecho Changed bot password for $hc($1)
- }
- else {
- remini users.ini $1 botpass
- if ($show) iecho Removed bot password for $hc($1)
- }
- }
- chinfo {
- if ($2 == $null) {
- iecho Syntax: /chinfo <user> [channel] [infoline|none]
- return
- }
- if ($usrhost($1) == $null) {
- if ($usr($1)) iecho Can't find $hc($1) on userlist, try $hc($usr($1)) instead.
- else iecho Can't find $hc($1) on userlist.
- return
- }
- if (($findtok($usrchans($1),$2,1,44) == $null) && ($2 ischan)) addchan $1-2
- if ($findtok($usrchans($1),$2,1,44)) {
- if ($3- == none) {
- remini users.ini $1 infoline. [ $+ [ $2 ] ]
- if ($show) iecho Removed infoline for $hc($1) in $2
- }
- else {
- writeini -n users.ini $1 infoline. [ $+ [ $2 ] ] $strip($3-)
- if ($show) iecho Changed infoline for $hc($1) in $2 to " $+ $strip($3-) $+ "
- }
- }
- elseif ($2- == none) {
- remini users.ini $1 infoline
- if ($show) iecho Removed infoline for $hc($1)
- }
- elseif ($2) {
- writeini -n users.ini $1 infoline $strip($2-)
- if ($show) iecho Changed infoline for $hc($1) to " $+ $strip($2-) $+ "
- }
- }
- bans {
- if ($ulist(*,20,0)) iecho Recorded bans:
- else {
- iecho No bans recorded.
- return
- }
- set %i.bans 0
- :start
- inc %i.bans
- if ($ulist(*,20,%i.bans)) {
- echo -a [[ $+ $lfix(3,%i.bans) $+ ]] $ulist(*,20,%i.bans)
- echo -a $fix(5,) $readini bans.ini $ulist(*,20,%i.bans) reason
- echo -a $fix(5,) Channels: $readini bans.ini $ulist(*,20,%i.bans) channels
- goto start
- }
- iecho End of banlist.
- }
- addban {
- if ($1 == $null) {
- iecho Syntax: /addban <hostmask> <channels> [reason]
- return
- }
- if ($ulist($1,20,0)) {
- iecho A ban matching $hc($1) already exists!
- return
- }
- if ($2) set %banchans $2
- else set %banchans $$?="Channels (enter 'all' for all chans)"
- if ($3) set %reason $3-
- else set %reason $?="Reason"
- if (%reason == $null) set %reason request
- if ($right($gettok(%reason,1,32),1) != :) set %reason $usr($me) $+ : %reason
- writeini -n bans.ini $1 reason %reason
- writeini -n bans.ini $1 channels %banchans
- .auser 20 $1
- .save -ru users.mrc
- colupdt3 $1
- if (%banchans == all) set %banchans $mychans
- unset %tmp.addban
- set %i.addban 0
- :start
- inc %i.addban
- if ($gettok(%banchans,%i.addban,44)) {
- if ($me isop $gettok(%banchans,%i.addban,44)) set %tmp.addban %tmp.addban $+ $crlf $+ mode $gettok(%banchans,%i.addban,44) b $1
- goto start
- }
- if (%tmp.addban) .quote %tmp.addban
- unset %reason %banchans
- if ($show) iecho Shitlisted $hc($1) successfully.
- }
- remban {
- if ($1 == $null) {
- iecho Syntax: /remban <hostmask>
- return
- }
- if ($ulist($1,20,1) == $null) {
- iecho No such ban ( $+ $hc($1) $+ )
- bans
- return
- }
- remini bans.ini $ulist($1,20,1)
- .timer 1 0 colupdt3 $ulist($1,20,1)
- .ruser 20 $ulist($1,20,1)
- .save -ru users.mrc
- if ($show) iecho Ban on $hc($1) has been removed.
- }
- addhost {
- if ($2 == $null) iecho Syntax: /addhost <username> <hostmask>
- elseif ($usrhost($1) == $null) iecho Can't find $hc($1) on userlist.
- elseif ($readini -n users.ini users $2 != $null) iecho That hostmask is already added for another user!
- elseif ($findtok($hstmask($1),$2,1,32)) iecho Host $hc($2) already in hostmask list for $hc($1) $+ .
- else {
- .auser 40 $2
- .save -ru users.mrc
- writeini -n users.ini $1 hostmask $hstmask($1) $2
- writeini -n users.ini Users $2 $1
- colupdt3 $2
- if ($show) iecho Added hostmask $hc($2) to $hc($1)) $+ .
- }
- }
- remhost {
- if ($2 == $null) iecho Syntax: /remhost <username> <hostmask>
- elseif ($usrhost($1) == $null) iecho Can't find $hc($1) on userlist.
- elseif ($findtok($hstmask($1),$2,1,32) == $null) iecho Host $hc($2) not in hostmask for $hc($1) $+ .
- elseif ($hstmask($1) == $2) iecho Can not remove hostmask from $hc($1) $+ , no other hosts!
- else {
- .ruser 40 $2
- .save -ru users.mrc
- remini users.ini Users $2
- writeini -n users.ini $1 hostmask $remtok($hstmask($1),$2,1,32)
- colupdt3 $2
- if ($show) iecho Removed hostmask $hc($2) from $hc($1) $+ .
- }
- }
-